﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Mobile/Masters/MobileSite.master" AutoEventWireup="true" CodeFile="EditAccount.aspx.cs" Inherits="Mobile_EditAccount" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Title" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Head" Runat="Server">
<script language="javascript" type="text/javascript">
<!--
    window.onload = UpdateCountry;

    function UpdateCountry() {
        document.update_form.ddlCountry.value = 225;
    }

    function ValidateForm() {
        //First Name
        if (document.update_form.txtFirstName.value == "") {
            alert("Error: Please enter your first name.");
            document.update_form.txtFirstName.focus();
            return false;
        }

        //Last Name
        if (document.update_form.txtLastName.value == "") {
            alert("Error: Please enter your last name.");
            document.update_form.txtLastName.focus();
            return false;
        }

        //Email
        var email = document.update_form.txtEmail.value;
        var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

        if (email == "" || (re.test(email) == false)) {
            alert("Error: Please enter a valid email address.");
            document.update_form.txtEmail.focus();
            return false;
        }

        //Confirm Email
        if (document.update_form.txtConfirmEmail.value != document.update_form.txtEmail.value) {
            alert("Error: Your email addresses don't match.");
            document.update_form.txtEmail.focus();
            return false;
        }

        //Password
        if (document.update_form.txtPassword.value == "") {
            alert("Error: Please enter a password.");
            document.update_form.txtPassword.focus();
            return false;
        }

        //Confirm Password
        if (document.update_form.txtPassword.value != document.update_form.txtConfirmPass.value) {
            alert("Error: Your passwords don't match.");
            document.update_form.txtPassword.focus();
            return false;
        }

        //Address
        if (document.update_form.txtAddress1.value == "") {
            alert("Error: Please enter your address.");
            document.update_form.txtAddress1.focus();
            return false;
        }

        //City
        if (document.update_form.txtCity.value == "") {
            alert("Error: Please enter your city.");
            document.update_form.txtCity.focus();
            return false;
        }

        //State
        if (document.update_form.txtState.value == "") {
            alert("Error: Please enter your state/province.");
            document.update_form.txtState.focus();
            return false;
        }

        //Postcode
        if (document.update_form.txtZip.value == "") {
            alert("Error: Please enter your zip/post code.");
            document.update_form.txtZip.focus();
            return false;
        }

        //Country
        if (document.update_form.ddlCountry.value == 0) {
            alert("Error: Please select your country.");
            document.update_form.ddlCountry.setActive();
            return false;
        }

        //Phone Number
        if (document.update_form.txtPhone.value == "") {
            alert("Error: Please enter your phone number.");
            document.update_form.txtPhone.focus();
            return false;
        }

        //submit form
        //update_form.method="post";
        //update_form.action="/account/update-submit.asp";
        //update_form.submit();
        return true;
    }
-->
</script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadBody" Runat="Server">
<header>
	<div class="sortable">
		<ul>
			<li><a href="Default.aspx"><strong>E-Document</strong></a></li>
			<li><a href="Login.aspx"><strong>Tài khoản</strong></a></li>
			<li><a href="Default.aspx"><strong>Danh mục</strong></a></li>
		</ul>
		<div class="edge"></div>
		<div class="edge right"></div>
	</div>
</header>

<header>
    <a class="goback" href="javascript: history.go(-1)"><strong>Back</strong></a>
    <h1>Modify Details</h1>
</header>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" Runat="Server">
<div id="bookdesc">
    <div id="storelisting-small" style="padding:8px">
        <h2>Current Details</h2><br />
        <p>Please update your details so that our records are accurate.
        All the fields in this section are required, please fill out every field.</p>

<form name="update_form" action="" method="post" onsubmit="return ValidateForm();">
    <input type="hidden" name="txtOldEmail" value="anhhung123@gmail.com" />
    <input type="hidden" name="easyCheckout" value="1" />

<table cellspacing="0" cellpadding="0" width="100%" summary="This table contains two columns of credit card details that you will need to fill out to purchase your shopping cart items. The 'process order' button is just after this table." border="0" class="transform">
 	<tr>
 		<td valign="top">
            <p class="blue">Username</p>
		    <p class="red">anhhung123@gmail.com</p>

			<p class="blue">First Name<br />
            <input name="txtFirstName" type="text" id="txtFirstName" value="Anh" /></p>

			<p class="blue">Last Name<br />
            <input name="txtLastName" type="text" id="txtLastName" value="Hung" /></p>

			<p class="blue">Email Address<br />
            <input name="txtEmail" type="email" id="txtEmail" value="anhhung123@gmail.com" /></p>

			<p class="blue">Confirm Email Address<br />
            <input name="txtConfirmEmail" type="email" id="txtConfirmEmail" value="anhhung123@gmail.com" /></p>

			<p class="blue">Password<br />
            <input name="txtPassword" type="password" id="txtPassword" value="[password]" /></p>

			<p class="blue">Confirm Password<br />
            <input name="txtConfirmPass" type="password" id="txtConfirmPass" value="[password]" /></p><br />
            <p class="blue">Address<br />
            <input name="txtAddress1" type="text" id="txtAddress1" value="" /><br>

            <input name="txtAddress2" type="text" id="txtAddress2" style="margin-top:3px;" value="" /></p>

            <p class="blue">City<br />
            <input name="txtCity" type="text" id="txtCity" value="" /></p>

			<p class="blue">State<br />
			<input name="txtState" type="text" id="txtState" value="" /></p>

			<p class="blue">Country<br />

            <select name="ddlCountry" id="ddlCountry">
					<option value="0" selected="selected">---- Choose a country ----</option>
<option value="225">United States</option>
<option value="47">China</option>
<option value="52">Christmas Island</option>
<option value="38">Cocos (Keeling) Islands</option>
<option value="48">Colombia</option>
<option value="117">Comoros</option>
<option value="120">Kuwait</option>
<option value="243">Zimbabwe</option>
			</select></p>

			<p class="blue">Zip/Post Code<br />

			<input name="txtZip" type="text" id="txtZip" value="" /></p>

			<p class="blue">Phone<br />
            <input name="txtPhone" type="number" id="txtPhone" value="" /></p>
            <!--
			<p class="blue">Easy Checkout<br />
            <select name="easyCheckout">
            <option value="1" selected>On</option>
            <option value="0" >Off</option>
            </select>
			-->
			<br />
			<input type="hidden" name="hdr" value="" />
			<p><input type="submit" class="button-big" value="Modify Details" /><br /><br /></p>
            </td>

		</tr>
	</table>
	</form>
	</div>
</div>
</asp:Content>

